<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    function equalsArray(arr){
        var brr=[...arr].reverse()
        for(i=0;i<brr.length;i++){
            if(arr[i]!==brr[i]){
                return false;
            }
        }
        return true;
    }
    console.log(equalsArray([1,2,1]));
    
</script>